﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Data.Enum;
using Identity.IdentityEntities;
using Microsoft.AspNet.Identity;

namespace Identity.Entities
{
    /// <summary>
    /// 后台系统用户
    /// </summary>
    public class SysUser : IdentityUser
    {
        /// <summary>
        /// 编号
        /// </summary>
        [StringLength(200)]
        [Required]
        public string Code { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        [StringLength(200)]
        [Required]
        public override string UserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [StringLength(32)]
        [Required]
        public override string PasswordHash { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        [StringLength(200)]
        public string Nick { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public byte Gender { get; set; } = (byte)Data.Enum.Gender.未知;
        /// <summary>
        /// 身份证
        /// </summary>
        [StringLength(18)]
        public string IdCard { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        [StringLength(11)]
        public string Mobile { get; set; }
        /// <summary>
        /// 个人邮箱
        /// </summary>
        [StringLength(200)]
        public override string Email { get; set; }

        /// <summary>
        /// 生日
        /// </summary>
        public DateTime Birthday { get; set; } = Time.Init;
        /// <summary>
        /// 家庭住址
        /// </summary>
        [StringLength(2000)]
        public string Address { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        [StringLength(2000)]
        public string Description { get; set; }

        public IList<UserLoginInfo> UserLoginInfos { get; set; }
    }
}